<?php if(!isset($pre_name)):?>
	<?php $pre_name = ""; ?>
<?php endif;?>
<?php if(isset($categories)):?>
	<?php foreach($categories as $category):?>
	
		<?php $selected = ""; ?>
		<?php if(isset($_GET['cat']) && $_GET['cat'] == $category->id):?>
			<?php $selected = " selected='selected' "; ?>
		<?php endif;?>
		<option value="<?php echo $category->id; ?>" <?php echo $selected; ?>><?php echo "{$pre_name}{$category->name}";?> (<?php echo $category->num_nodes; ?>)</option>
		
		<?php if(isset($category->categories)):?>
			<?php $this->load->view($template_path ."pages/nodes/partials/options_categories", array("categories" => $category->categories, "pre_name" => "{$pre_name}&nbsp;&nbsp;&nbsp;"));?>
		<?php endif;?>
	
	<?php endforeach;?>
<?php endif;?>